cet_validate_cs(const char *cs, cet_cs_vec_t **vec, char **cs_name)
{
char buff[128];
- char *c;
cet_cs_vec_t *v;
if ((cs == NULL) || (strlen(cs) == 0)) /* set default us-ascii */
v = cet_find_cs_by_name(cs);
if (v != NULL)
{
- strncpy(buff, v->name, sizeof(buff));
- c = buff;
- while (*c != '\0')
- {
- *c = toupper(*c);
- c++;
- }
- *cs_name = xstrdup(buff);
+ *cs_name = strupper(xstrdup(v->name));
*vec = v;
return 1;
}
/*
- Support for CompeGPS waypoint (.wpt), route (.rte) and track (.trk) files,
+ Support for CompeGPS waypoint (.wpt), route (.rte) and track (.trk) files,
Copyright (C) 2005 Olaf Klein, o.b.klein@t-online.de
if (wpt->creation_time != 0)
{
- char *cx = buff;
tm = *gmtime(&wpt->creation_time);
strftime(buff, sizeof(buff), "%d-%b-%y %H:%M:%S", &tm);
- while (*cx != '\0')
- {
- *cx = toupper(*cx);
- cx++;
- }
+ strupper(buff);
}
fprintf(fout, "T A %.10f%c%c %.10f%c%c ",
free_header(unknown_header);
while ((str = csv_lineparse(NULL, "\t", "", column++))) {
- header_lines[unknown_header][column] = xstrdup(str);
- for (str = header_lines[unknown_header][column]; *str; str++) {
- *str = toupper(*str);
- }
+ header_lines[unknown_header][column] = strupper(xstrdup(str));
header_ct[unknown_header]++;
if (header_ct[unknown_header] >= MAX_HEADER_FIELDS) break;
}
fields = xmalloc(i + 2);
strcpy(fields, headers[ht]);
strcat(fields, "\t");
- for (c = fields; *c; c++) {
- *c = toupper(*c);
- }
- c = fields;
+ c = strupper(fields);
while ((c = strchr(c, '\t'))) *c++ = '\0';
for (i = 0; i < header_ct[unknown_header]; i++) {
queue *elem, *tmp;
extern queue waypt_head;
const char *snptr;
- char *tmp_sn, *tmp_ptr;
+ char *tmp_sn;
unsigned long last_crc;
char ssid[32 + 5 + 1];
QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
bh->wpt = (waypoint *) elem;
snptr = bh->wpt->shortname;
- tmp_sn = xstrdup(snptr);
- for (tmp_ptr = tmp_sn; *tmp_ptr; tmp_ptr++)
- *tmp_ptr = tolower(*tmp_ptr);
+ tmp_sn = strlower(xstrdup(snptr));
bh->crc = get_crc32(tmp_sn, strlen(snptr));
xfree(tmp_sn);
i ++;
double lon,lat;
int icon_token = 0;
char tbuf[1024];
- char *tp = tbuf;
time_t tm = wpt->creation_time;
lon = degrees2ddmm(wpt->longitude);
if (tm == 0)
tm = current_time();
strftime(tbuf, sizeof(tbuf), "%d-%b-%y %I:%M:%S", localtime(&tm));
- while (*tp) {
- *tp = toupper(*tp);
- tp++;
- }
+ strupper(tbuf);
if (deficon) {
icon_token = atoi(deficon);
static void
tpo_write_file_header()
{
- int i;
-
/* force upper-case state name */
- for (i=0; i<(int)strlen(output_state); i++) {
- output_state[i] = toupper(output_state[i]);
- }
+ strupper(output_state);
if (strncmp("CA", output_state, 2) == 0) {